package com.wimcorp.magic.abilities;

import javax.persistence.Entity;
import javax.persistence.Table;

import com.wimcorp.magic.abilities.trigger.AbilityTrigger;
import com.wimcorp.magic.behaviour.Behaviour;
import com.wimcorp.magic.board.CardType;
import com.wimcorp.magic.cards.Creature;
import com.wimcorp.magic.cards.Planeswalker;
import com.wimcorp.magic.cards.PlayingCard;
import com.wimcorp.magic.input.Target;

/**
 * example {target : 'OPPONENT',types:['CREATURE'],locations:['BATTLEFIELD'],behaviors:['FLYING'],amount:'2'}
 * 
 * target options : SELF,OPPONENT,ANY
 * 
 * type options : CREATURE,PLANESWALKER
 * 
 * location options : BATTLEFIELD
 * 
 * behaviors options :
 */
@Entity
@Table(name = "destroytarget", schema = "abilities")
public class DestroyTarget extends Ability {

	
	protected DestroyTarget() {
	}

	public DestroyTarget(AbilityTrigger trigger) {
		super(trigger);
	}
	
	public DestroyTarget(DestroyTarget ability){
		super(ability);
	}

	@Override
	protected void executeAbility() {
		PlayingCard card = getAbilityTarget();
		if(card != null){
			card.graveyard();
		}
		

	}

	@Override
	public DestroyTarget clone() {
		return new DestroyTarget(this);
	}
	
	@Override
	public boolean isInputRequired(){
		if (Target.THIS.equals(getTarget())) {
			return false;
		}
		return true;
	}

}
